package com.syher.springboot.activemq.app.consume;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Component;

@Component
public class Consumer {

    /**
     * 使用JmsListener配置消费者监听的队列
     *
     * @param text 接收到的消息
     */
    @JmsListener(destination = "receive")
    @SendTo("reply")
    public String receiveQueue(String text) {
        System.out.println("Consumer receive message: " + text);
        return "get message";
    }
}
